## Script (Python) "date_nfois"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=
##title=
##
# Retourne un tuple contenant deux dates :
# [ '15/<mois + 1>/<année>', '15/<mois + 2>/<année>' ]

moisjour = [ 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 ]

# date du jour
now = DateTime()
D = now.strftime('%d')
M = now.strftime('%m')
Y = now.strftime('%Y')

aM = (int(M) + 1) % 12

bM = (int(M) + 2) % 12

if aM == 0:
    aM = 12

if bM == 0:
    bM = 12

if aM < 10:
    aM = '0' + str(aM) 

if bM < 10:
    bM = '0' + str(bM) 

aY = Y

bY = Y

if (int(M) + 2) > 12:
    bY = int(Y) + 1
if (int(M) + 1) > 12:
    aY = int(Y) + 1

if int(D) == moisjour[int(M) - 1]:
    D1 = moisjour[int(M)]
    D2 = moisjour[(int(M) + 1) % 12]
else:
    if (int(D) == 30) and (int(M) == 1):
        D1 = 28
    else:
        D1 = D
    D2 = D

return [ str(D1) + '/' + str(aM) + '/' + str(aY), str(D2) + '/' + str(bM) + '/' + str(bY) ]

